import request from '@/utils/request'

export function getAgents(params) {
  return request({
    url: '/agents',
    params
  })
}

// 删除
export function delAgent(id) {
  return request({
    url: `/agents/${id}`,
    method: 'delete'
  })
}

// 跟据id 获取单个数据
export function getAgent(id) {
  return request({
    url: `/agents/${id}`
  })
}

// 编辑
export function editAgent(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}
// 新增
export function addAgent(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 获取数据数量
export function getAgentCount(params) {
  return request({
    url: '/agents/count',
    method: 'get',
    params
  })
}

